import axios from '../../utils/request';
import request from '@/utils/request.ts'

enum API {
	ACCOUNT_URL = '/api/v1/system/user/searchPage', // 获取账号信息
	ADDACCOUNT_URL = '/api/v1/system/user/add',// 添加账号信息
	EDITACCOUNT_URL = '/api/v1/system/user/detail',// 编辑账号信息
	CONFIRMACCOUNT_URL = '/api/v1/system/user/update',// 提交账号信息
	ACCOUNTHOSPITAIINFO_URL = '/api/v1/hospital/list',// 获取账号医院信息
	RESETPASSWORD_URL = '/api/v1/system/user/resetPassword',// 重置密码
	UPLOAD_LOGO = '/api/v1/system/user/upload',// 上传logo
	GET_LOGO = '/api/v1/system/user/query-logo',// 获取logo
}

// 获取账号信息
export const reqAccountList = (data:any) => {
	return axios({
		url:API.ACCOUNT_URL,
		method:'post',
		data,
	})
}

// 添加账号信息
export const reqAddAccount = (data: any) => {
    return axios({
		url:API.ADDACCOUNT_URL,
		method:'post',
		data,
	})
}


// 编辑账号信息
export const reqEditAccount = (id: any) => {
	return axios({
		url:API.EDITACCOUNT_URL + `?id=${id}`,
		method:'get',
	})
}

// 确定编辑账号信息
export const reqConfirmAccount = (data: any) => {
	return axios({
		url:API.CONFIRMACCOUNT_URL,
	    method:'post',
		data,
	})
}

// 获取医院下拉列表
export const reqAccountHosInfo = () => {
    return axios({
		url:API.ACCOUNTHOSPITAIINFO_URL,
		method:'get',
	})
}

// 重置密码
export const reqResetPassword = (id: any) => {
    return axios({
		url:API.RESETPASSWORD_URL + `?userId=${id}`,
		method:'get',
	})
}
// 上传logo
export function upLoadLogo(data:any){
    return request({
        url: API.UPLOAD_LOGO,
        method:'post',
        data
    })
}
// 获取logo
export function getLogo(data:any){
    return request({
        url: API.GET_LOGO,
        method:'get',
        data
    })
}
